<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>仓库管理</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../../../component/elementUI/index.css">
  <link rel="stylesheet" href="../../../style/index.css">
</head>

<body>
  <div id="app" class="minWidth">
    <el-form :inline="true" :form="form">
      <el-form-item>
        <el-button type="primary" v-if="JSON.parse(sessionStorage.getItem('RoleArr')).some(item=>item=='B0066')"
          @click="addEnterprise">添加</el-button>
      </el-form-item>
      <el-form-item>
        <el-select v-model.trim="form.Warehouse_Type" clearable @change="onSerach" placeholder="请选择仓库类型" filterable
          style="width: 100%">
          <el-option label="自用仓库" value="0"></el-option>
          <el-option label="开放仓库" value="1"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-select v-model.trim="form.Applicable_Type" clearable @change="onSerach" placeholder="请选择自营/第三方仓库" filterable
          style="width: 100%">
          <el-option label="自营仓库" value="0"></el-option>
          <el-option label="第三方仓库" value="1"></el-option>
        </el-select>
      </el-form-item>
    </el-form>

    <el-table :data="tableData" stripe border height="calc(100vh - 140px)" @expand-change="handleChildren"
      style="width: 100%">
      <el-table-column label="查看" width="50" type="expand">
        <template slot-scope="props">
          <el-table :data="props.row.Children.warehouse_inventory">
            <el-table-column label="序号" width="50" type="index"></el-table-column>
            <el-table-column prop="Article_Name" label="商品名称"></el-table-column>
            <el-table-column prop="Picture_URL" label="商品图片">
              <template v-slot="{row}">
                <el-image style="width: 100px; height: 100px; border-radius: 9px;" fit="cover"
                  :src="DomainIMG + row.Picture_URL"></el-image>
              </template>
            </el-table-column>
            <el-table-column prop="Inventory_Total_Quantity" label="存货总量"></el-table-column>
            <el-table-column prop="Remain_Quantity" label="剩余数量"></el-table-column>
            <el-table-column prop="Out_Total_Quantity" label="出库数量"></el-table-column>
            <el-table-column prop="Prediction_Quantity" label="预售数量"></el-table-column>
          </el-table>
        </template>
      </el-table-column>
      <el-table-column label="序号" width="50" type="index"></el-table-column>
      <el-table-column prop="Warehouse_Name" label="仓库名称"></el-table-column>
      <el-table-column prop="Warehouse_Address" label="仓库地址"></el-table-column>
      <el-table-column prop="Warehouse_Type" label="仓库类型">
        <template v-slot="{row}">
          {{row.Warehouse_Type=='0'?'自用仓库':'开发仓库'}}
        </template>
      </el-table-column>
      <el-table-column prop="Applicable_Type" label="仓库性质">
        <template v-slot="{row}">
          {{row.Applicable_Type=='0'?'自营仓库':'第三方仓库'}}
        </template>
      </el-table-column>
      <el-table-column prop="Enterprise_Name" label="归属企业"></el-table-column>
      <el-table-column label="操作" width="300">
        <template v-slot="{row}">
          <!--  v-if="row.Warehouse_Initialize==0&&JSON.parse(sessionStorage.getItem('RoleArr')).some(item=>item=='B0067')" -->
          <el-button type="success" size="small" v-if="row.Warehouse_Initialize==0"
           
            @click="GoWareDetail(row)">初始化</el-button>
          <el-button type="primary" size="small"
            v-if="JSON.parse(sessionStorage.getItem('RoleArr')).some(item=>item=='B0068')"
            @click="editMember(row.Warehouse_SerialNumber)">编辑</el-button>
          <el-button type="danger" size="small"
            v-if="JSON.parse(sessionStorage.getItem('RoleArr')).some(item=>item=='B0068')"
            @click="deletMember(row.Warehouse_SerialNumber)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <el-pagination background v-show="total > 0" @size-change="handleSizeChange" @current-change="handleCurrentChange"
      :current-page="form.page" :page-sizes="[10, 20, 30, 50]" :page-size="form.limit"
      layout="total, sizes, prev, pager, next, jumper" :total="total">
    </el-pagination>
  </div>
  <script type="text/javascript" src="../../../utils/jquery-3.6.0.min.js"></script>
  <script type="text/javascript" src="../../../utils/jquery.cookie.js"></script>
  <script type="text/javascript" src="../../../utils/vue.min.js"></script>
  <script type="text/javascript" src="../../../component/elementUI/index.js"></script>
  <script type="text/javascript" src="../../../utils/utils.js"></script>
  <script type="text/javascript" src="./js/Warehouse.js"></script>
</body>

</html>